<?php

define('FL_SUCCESS', 'taskmodule.flashmessage.success');
define('FL_NOTICE', 'taskmodule.flashmessage.notice');
define('FL_ERROR', 'taskmodule.flashmessage.error');

class TaskModule extends CWebModule{
    
    public $emailSender = null;
    
    public function init(){
        $this->setImport(array(
            'task.models.*',
            'task.components.*',
        ));
        if(is_null($this->emailSender)){
            $this->emailSender = array('task@'.$_SERVER['HTTP_HOST']=>'Почтовик-Мочтовик');
        }
    }

    public function beforeControllerAction($controller, $action){
        if(parent::beforeControllerAction($controller, $action))
        {
            return true;
        }
        else
            return false;
    }
    
    public static function t($type, $mes, $params=array()){
        return Yii::t('taskmodule.'.$type, $mes, $params);
    }
}
